# core/database/sqlite_manager.py
class SQLiteWrapper:
    def safe_execute(self, query, params):
        with self.connection:  # 自动提交事务
            cursor = self.connection.cursor()
            cursor.execute(query, params)
            return cursor
        
    def get_song_by_title(self, title):
        return self.safe_execute(
            "SELECT * FROM songs WHERE title = ?",
            (title,)
        )